home *** CD-ROM | disk | FTP | other *** search
/ 321 GAMES / 321GAMES.iso / advent / zoom / pizza / zoom.dxr / 00001_Richard's Movie Script.ls next >
Encoding:
Text File  |  1996-03-28  |  5.6 KB  |  242 lines

  1. global gfudgefactor, gPicList, gAutoInterval, gAutoDelay, gQuitDelay, gDemoState, gPicNumList, gPicSpriteList, gWhatTimeIsIt, gSndList, gColorDepth, gFinalExit
  2.  
  3. on startMovie
  4.   spriteVisibility(1, 48, 1)
  5.   ResetDemo()
  6.   set whatsndfolder to "zoomsnd"
  7.   if the machineType = 256 then
  8.     set fileSep to "/"
  9.   else
  10.     set fileSep to ":"
  11.   end if
  12.   set the volume of sound 1 to 255
  13.   set the volume of sound 2 to 255
  14.   set gAutoInterval to 5 * 60
  15.   set gAutoDelay to 180 * 60
  16.   set gQuitDelay to 180 * 60
  17.   if the machineType = 256 then
  18.     checkPrefFile("zbnipref.txt", "zoombini.exe", "begin", "Wait")
  19.   end if
  20.   checkMonitor("start")
  21.   set the exitLock to 1
  22. end
  23.  
  24. on stopMovie
  25.   spriteVisibility(1, 48, 1)
  26.   checkMonitor("stop")
  27.   XobjCleanup()
  28.   clearGlobals()
  29. end
  30.  
  31. on keyDown
  32.   checkExit()
  33. end
  34.  
  35. on checkExit
  36.   if the keyCode = 53 then
  37.     if gFinalExit <> "LastRoundUp" then
  38.       setUpPuppets(1, 48, 0)
  39.       MouseLock(1)
  40.       set gFinalExit to "LastRoundUp"
  41.       go("fadeOut")
  42.     end if
  43.   end if
  44. end
  45.  
  46. on XobjCleanup
  47.   if objectp(gFileObj) then
  48.     gFileObj(mdispose)
  49.   end if
  50.   if objectp(gUtilObj) then
  51.     gUtilObj(mdispose)
  52.   end if
  53. end
  54.  
  55. on checkMonitor whichState
  56.   if whichState = "start" then
  57.     if the colorDepth <> 8 then
  58.       if the machineType = 256 then
  59.         alert("This Demo requires that your monitor be set to 256 colors (8-bit).  Please adjust your settings, restart Windows, and begin this demo again!")
  60.         quit()
  61.       else
  62.         set gColorDepth to the colorDepth
  63.         set the colorDepth to 8
  64.       end if
  65.     end if
  66.   else
  67.     if the machineType <> 256 then
  68.       if gColorDepth <> EMPTY then
  69.         set the colorDepth to gColorDepth
  70.       end if
  71.     end if
  72.   end if
  73. end
  74.  
  75. on ResetDemo
  76.   set HowManyPics to 5
  77.   set gPicNumList to []
  78.   set gPicList to ["Island", "Allergic", "Caves", "Pizza", "Camp"]
  79.   set gSndList to ["Zmb_100.aif", "Zmb_060.aif", "Zmb_070.aif", "Zmb_080.aif", "Zmb_090.aif"]
  80.   set gPicSpriteList to [2, 3, 4, 5, 6]
  81.   set totalPick to 0
  82.   set gDemoState to "notDemo"
  83.   spriteVisibility(1, 48, 1)
  84.   repeat while totalPick < HowManyPics
  85.     set NewNumber to random(HowManyPics)
  86.     if getOne(gPicNumList, NewNumber) = 0 then
  87.       add(gPicNumList, NewNumber)
  88.       set totalPick to totalPick + 1
  89.     end if
  90.   end repeat
  91. end
  92.  
  93. on setUpPuppets start, end, switch
  94.   repeat with x = start to end
  95.     puppetSprite(x, switch)
  96.   end repeat
  97. end
  98.  
  99. on spriteVisibility start, end, switch
  100.   repeat with x = start to end
  101.     set the visible of sprite x to switch
  102.   end repeat
  103. end
  104.  
  105. on checkRollover FirstSprite, LastSprite
  106.   repeat with x = FirstSprite to LastSprite
  107.     if rollOver(x) = 1 then
  108.       set the visible of sprite x to 1
  109.       next repeat
  110.     end if
  111.     set the visible of sprite x to 0
  112.   end repeat
  113. end
  114.  
  115. on ButtonHiLite
  116.   set whichNumber to the castNum of sprite the clickOn
  117.   if rollOver(the clickOn) = 1 then
  118.     set the hilite of cast whichNumber to 1
  119.   else
  120.     set the hilite of cast whichNumber to 0
  121.   end if
  122. end
  123.  
  124. on CheckTheTimer
  125.   if (gDemoState = "Demo") or (the timer > gAutoDelay) then
  126.     startTheDemo()
  127.   end if
  128. end
  129.  
  130. on initGlobals
  131.   set gDemoState to "notDemo"
  132. end
  133.  
  134. on mouseUp
  135.   if gDemoState = "Demo" then
  136.     go("fadeOut")
  137.   end if
  138. end
  139.  
  140. on exitAutoRun
  141.   dontPassEvent()
  142.   initGlobals()
  143.   ResetDemo()
  144.   MouseLock(1)
  145.   puppetSound(0)
  146.   set listSize to count(gPicSpriteList)
  147.   repeat with x = 1 to listSize
  148.     set spriteNum to getAt(gPicSpriteList, x)
  149.     setUpPuppets(spriteNum, spriteNum, 0)
  150.   end repeat
  151.   set the volume of sound 1 to 255
  152.   set the volume of sound 2 to 255
  153.   go("Begin")
  154. end
  155.  
  156. on startTheDemo
  157.   set gDemoState to "Demo"
  158.   set the mouseDownScript to "exitAutoRun"
  159.   set the mouseUpScript to "dontPassEvent"
  160.   if the timer > gAutoInterval then
  161.     if gPicNumList = [] then
  162.       spriteVisibility(1, 48, 1)
  163.       go("Leave")
  164.       exit
  165.     end if
  166.     go("SwapPics")
  167.   end if
  168. end
  169.  
  170. on SwapThePic
  171.   if gDemoState = "Demo" then
  172.     set nextRanNum to getAt(gPicNumList, 1)
  173.     set NextPicSprite to getAt(gPicSpriteList, nextRanNum)
  174.     set nextPic to getAt(gPicList, nextRanNum)
  175.     deleteAt(gPicNumList, 1)
  176.     set nextSnd to getAt(gSndList, nextRanNum)
  177.   else
  178.     if getOne(gPicSpriteList, the clickOn) = 0 then
  179.       exit
  180.     end if
  181.     set NextPicSprite to the clickOn
  182.     set NextPicSpritePos to getOne(gPicSpriteList, NextPicSprite)
  183.     set nextPic to getAt(gPicList, NextPicSpritePos)
  184.     set nextSnd to getAt(gSndList, NextPicSpritePos)
  185.   end if
  186.   spriteVisibility(2, 6, 1)
  187.   set NewCast to the number of cast (nextPic & "PIC")
  188.   set the castNum of sprite NextPicSprite to NewCast
  189.   put NewCast
  190.   puppetSound(nextSnd)
  191. end
  192.  
  193. on SkipAhead SkipToWhere
  194.   puppetSound(0)
  195.   unLoadCast()
  196.   set the mouseDownScript to "DontPassEvent"
  197.   set the mouseUpScript to "DontPassEvent"
  198.   go(SkipToWhere)
  199. end
  200.  
  201. on idle
  202. end
  203.  
  204. on WaitHere howLong
  205.   set startTime to the ticks
  206.   set endTime to startTime + (howLong * 60)
  207.   repeat while the ticks < endTime
  208.     nothing()
  209.   end repeat
  210. end
  211.  
  212. on MouseLock LockState
  213.   if gDemoState <> "Demo" then
  214.     if LockState = 0 then
  215.       set the mouseUpScript to EMPTY
  216.       set the mouseDownScript to EMPTY
  217.     else
  218.       set the mouseUpScript to "DontPassEvent"
  219.       set the mouseDownScript to "DontPassEvent"
  220.     end if
  221.   end if
  222. end
  223.  
  224. on goToArno
  225.   sound fadeOut 1, 2 * 60
  226.   MouseLock(1)
  227.   go("PleaseWait")
  228. end
  229.  
  230. on changeSndVolume whichChannel, whichWay, newVol
  231.   set currVol to the volume of sound whichChannel
  232.   if whichWay = "minus" then
  233.     repeat with volCount = currVol down to newVol
  234.       set the volume of sound whichChannel to volCount
  235.     end repeat
  236.   else
  237.     repeat with volCount = currVol to newVol
  238.       set the volume of sound whichChannel to volCount
  239.     end repeat
  240.   end if
  241. end
  242.